RxJava Essentials by Morgillo Ivan

RxJava Essentials by Morgillo Ivan

Author:Morgillo, Ivan
Language: eng
Format: epub
Publisher: Packt Publishing
Published: 2015-05-26T16:00:00+00:00


Like sample(), timeout() uses the TimeUnit object to specify the time interval.

The next figure shows how the Observable will trigger onError() the moment the Observable violates the timeout constraint: the last item won't be emitted because it arrives after the timeout.

Debounce

The debounce() function filters out items emitted by the Observable that are rapidly followed by another emitted item; it only emits an item from Observable if a particular timespan has passed without it emitting another item.

Like sample() and timeout(), debounce() uses the TimeUnit object to specify the time interval.

The next figure shows how every time a new item is emitted from the Observable, debounce() starts its internal timer, and if no new item is emitted during this timespan, the last item is emitted by the new Observable:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.